package api

import (
	"Demo_GoFrame/src/common/response"
	"github.com/gogf/gf/database/gdb"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
	"github.com/gogf/gf/os/glog"
)

type LoveBirdApi struct {
}

var projectName string = "loveBird"

func getSelfLog() *glog.Logger {
	return g.Log(projectName)
}

func getDBModel(table string) *gdb.Model {
	return g.DB(projectName).Table(table).Safe()
}

func (selfApi *LoveBirdApi) GetTitle(r *ghttp.Request) {
	model := getDBModel("tab_hw_group")
	result, _ := model.All()
	getSelfLog().Info(result)
	response.ToSuccess(r, result)
}
